import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';

///
/// 加载svg图片
///
class XSvgImage {
  static Widget load(
    String name, {
    double? width,
    double? height,
    Color? color,
    BoxFit fit = BoxFit.contain,
  }) {
    return SvgPicture.asset(
      'assets/$name.svg',
      width: width,
      height: height,
      fit: fit,
      colorFilter: color != null ? ColorFilter.mode(color, BlendMode.srcIn) : null,
    );
  }
}
